<template>
  <view>
    <my-login v-if="!token_change"></my-login>
    <my-userinfo  v-else="token_change" v-on:changeSwitch="changeSwitch"></my-userinfo>
  </view>
</template>

<script>
  import { mapState,mapGetters,mapMutations } from 'vuex'
    import badgeMix from '@/mixins/tabbar-badge.js'
  export default {
    data() {
      return {
   
      };
    },
     mixins: [badgeMix],
    computed:{
      ...mapState('m_user',['userinfo','token']),
      ...mapGetters('m_user',['token_change'])
    },
    mounted(){
      console.log(this.userinfo)
    },
    methods:{
        ...mapMutations('m_user', ['clearStorage']),
      changeSwitch(){
        this.clearStorage();
      }
    }

  }
</script>

<style lang="scss">

</style>
